package net.example.model;

/**
 * Created by ZN on 2017/3/6.
 * 交互的类型。比如 请求视频会话，同意视频会话，拒绝视频会话，终止视频会话
 */
public enum CommunicateType {
    Request(0),
    Agree(1),
    Reject(2),
    Terminate(3),
    Busy(4);
    private int type;

    CommunicateType(int type) {
        this.type = type;
    }

    public int getType() {
        return type;
    }

    public static CommunicateType getCommunicateType(int code) {
        for (CommunicateType type : CommunicateType.values()) {
            if (type.getType() == code) {
                return type;
            }
        }
        return null;
    }
}
